<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
        <el-button @click="fn1"></el-button>
        <el-input @keyup.enter="fn"></el-input>
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        // 子向父传值 
    //   默认在vue里面不能给原生的事件绑定，如果要给，必须要添加一个native的修饰符
      Vue.component('el-button',{
          template:`
            <button @click="$emit('click')">按钮</button>
          `
      })
      Vue.component('el-input',{
          template:`
            <input />
          `
      })
      var vm = new Vue({
        el: '#app',
        data: {},
        methods: {
            fn(){
                console.log(123)
            },
            fn1(){
                console.log(2343)
            }
        },
      })
    </script>
  </body>
</html>
